import request from '@/axios/request'
import url from '@/axios/url'
const { mesUrl, adminUrl, baseDataUrl, commonserviceUrl } = url()
// 导出url
export const exportUrl = `${mesUrl}mesSalesOrder/export`
// 导出明细
export const exportAll = `${mesUrl}mesSalesOrderDetail/exportAll`
// 分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}mesSalesOrder`,
    method: 'get',
    params
  })
}
// 新增
export function rowCreate(data = {}) {
  return request({
    url: `${mesUrl}mesSalesOrder`,
    method: 'post',
    data
  })
}
// 修改
export function rowUpdate(data = {}) {
  return request({
    url: `${mesUrl}mesSalesOrder`,
    method: 'put',
    data
  })
}
// 删除
export function rowDel(id) {
  return request({
    url: `${mesUrl}mesSalesOrder/${id}`,
    method: 'put'
  })
}
// 详情
export function rowDetail(id) {
  return request({
    url: `${mesUrl}mesSalesOrder/info/${id}`,
    method: 'get'
  })
}

// 查询送货方式列表
export function getDeliveryMethodList() {
  return request({
    url: `${adminUrl}dict/type/shipping_method`,
    method: 'get'
  })
}
//查询客户列表
export function getCustomerList(params = {}) {
  return request({
    url: `${adminUrl}commonCustomer`,
    method: 'get',
    params
  })
}
//下拉框字典等
// 查询客商类别编码列表
export function getCustomerTypeValueList() {
  return request({
    url: `${adminUrl}dict/type/customer_type`,
    method: 'get'
  })
}
// 查询客商类别名称列表
export function getCustomerTypeNameList() {
  return request({
    url: `${adminUrl}dict/type/customer_type`,
    method: 'get'
  })
}
// 查询质检状态列表
export function getQualityTypeList() {
  return request({
    url: `${adminUrl}dict/type/quality_type`,
    method: 'get'
  })
}
// 订单监控信息
export function getWholeProcess(id) {
  return request({
    url: `${mesUrl}mesSalesOrder/getWholeProcess/${id}`,
    method: 'get'
  })
}
